package com.cn.dim.service.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.cn.dim.dao.ChkpointDao;
import com.cn.dim.pojo.Chkpoint;
import com.cn.dim.service.ChkpointService;
import com.github.pagehelper.PageHelper;
@Service("chkpointService")
public class ChkpointServiceImpl implements ChkpointService{
	@Resource
	ChkpointDao chkpointDao;
	@Override
	public List<Map<String, Object>> queryChkpoint(Map<String, Object> m) {//根据查询条件查询角色列表，列表的每一行以键值对的形式提现；
		// TODO Auto-generated method stub
		PageHelper.startPage(Integer.valueOf(m.get("pageIndex").toString()),Integer.valueOf(m.get("pageSize").toString()),true);
		return chkpointDao.queryChkpoint(m);
	}
	@Override
	public List<Map<String, Object>> queryChkpointlist(Map<String, Object> m) {//根据查询条件查询角色列表，列表的每一行以键值对的形式提现；
		// TODO Auto-generated method stub
		return chkpointDao.queryChkpointlist(m);
	}
	@Override
	public int insertChkpoint(Chkpoint c) {
		// TODO Auto-generated method stub
		return chkpointDao.insertChkpoint(c);
	}
	@Override
	public List<Map<String, Object>> queryUser(Map<String, Object> m) {
		// TODO Auto-generated method stub
		return chkpointDao.queryUser(m);
	}
	
	@Override
	public int updateChkpoint(Chkpoint c) {
		// TODO Auto-generated method stub
		return chkpointDao.updateChkpoint(c);
	}
	@Override
	public List<Map<String, Object>> getDep(Map<String, Object> m) {
		// TODO Auto-generated method stub
		return chkpointDao.getDep(m);
	}
	
	@Override
	public int delChkpoint(Map<String, Object> m) {
		// TODO Auto-generated method stub
		chkpointDao.delChkinputitem(m);
		chkpointDao.delChktask(m);
		int i=chkpointDao.delChkpoint(m);
		return i;
	}
	
	@Override
	public Chkpoint queryChkpointById(Map<String, Object> m) {
		// TODO Auto-generated method stub
		return chkpointDao.queryChkpointById(m);
	}
	@Override
	public List<Map<String, Object>> queryChkinputitemlist(
			Map<String, Object> param) {
		// TODO Auto-generated method stub
		return chkpointDao.queryChkinputitemlist(param);
	}
}
